/*
 * IncFile1.h
 *
 * Created: 2012-07-09 07:17:23
 *  Author: Antrykot
 */ 
#include "main.h"


#ifndef SCP_H_
#define SCP_H_

void setup_io();
void init_eeprom();

#define T2_START		TCCR2B = 7;	// 1024
#define T2_STOP			TCCR2B = 0;
#define T2_ENA			TIMSK2 = (1 << TOIE2);
#define T2_DIS			TIMSK2 = 0;

extern u8 t2_timeouts;

extern u16 nr;
extern u8 fkal;

extern u16 h_range;
extern u16 l_range;
extern u8 ksp_param;

extern u16 test;
////
#define EEP_NR		0x02
#define EEP_FKAL	0x04
#define EEP_KSP		0x06
#define EEP_RSTCNT	0x64
#define EEP_DATE	0x08

#define EEP_LRANGE	0x0A
#define EEP_HRANGE	0x0C
#define EEP_KSP_PARAM	0x0E
#define EEP_DIV		0x10
#define EEP_COUNT	500
#define EEP_KALDATE	0x12				// calibration date from KSP-3


#define LG_ON	//PORTB |= (1 << 7);
#define LG_OFF	//PORTB &= ~(1 << 7);

#define LR_ON	PORTB |= (1 << 7);
#define LR_OFF	PORTB &= ~(1 << 7);

#define LY_ON	PORTB |= (1 << 5);
#define LY_OFF	PORTB &= ~(1 << 5);

#define FTK_SET_TK	PORTD |= (1 << 6);
#define FTK_SET_F	PORTD &= ~(1 << 6);


#endif /* INCFILE1_H_ */